package internal

import (
	"context"

	fpyDcsDb "gf/fpy/dcs/db"
)

func init() {
	fpyDcsDb.SetSoPath("./fpy/dcs/db/.so/db.so")
	fpyDcsDb.SetDbUrl("http://192.168.8.101:11001")
	fpyDcsDb.SetDbSid("0ao6")
}

type SysDictDao struct {
	sid 	string
	dbSid   string
	projectSid 	string
	table   string
	group   string
	columns TSysDictColumns
}

type TSysDictColumns struct {
    Sid    string
    AddTime    string
    UpdateTime    string
    IsDel    string
    Code    string
    Name    string
    Psid    string
    Remark    string
    Sort    string
}


var cSysDictColumns = TSysDictColumns{
    Sid:    "sid",
    AddTime:    "add_time",
    UpdateTime:    "update_time",
    IsDel:    "is_del",
    Code:    "code",
    Name:    "name",
    Psid:    "psid",
    Remark:    "remark",
    Sort:    "sort",
}

func NewSysDictDao() *SysDictDao {
	return &SysDictDao{
		sid: 	"0apm",
		dbSid:	"0ao6",
		projectSid:	"dbd3",
		group:   "sys",
		table:   "dict",
		columns: cSysDictColumns,
	}
}

func (dao *SysDictDao) Columns() TSysDictColumns {
	return dao.columns
}

func (dao *SysDictDao) Group() string {
	return dao.group
}

func (dao *SysDictDao) Table() string {
	return dao.table
}

func (dao *SysDictDao) Ctx(ctx context.Context) *fpyDcsDb.TDb {
	return fpyDcsDb.Ctx(ctx).Table(dao.sid).FpyProjectSid(dao.projectSid)
}